home *** CD-ROM | disk | FTP | other *** search
- Path: news.infi.net!usenet
- From: nngis@norfolk.infi.net (Greg DiGiorgio)
- Newsgroups: comp.lang.c
- Subject: Re: String manipulation routines for C
- Date: 24 Feb 1996 20:44:21 GMT
- Organization: Customer of InfiNet
- Message-ID: <4gntb5$i41@nw002.infi.net>
- References: <4gio78$ipr@bart.rogerswave.ca>
- NNTP-Posting-Host: h-talisman.norfolk.infi.net
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.3
-
- In article <4gio78$ipr@bart.rogerswave.ca>, mfrisch@saturn.tlug.org
- says...
- >
- > I am a (Turbo)Pascal programmer from way back, but now I have
- moved
- >to Unix and C. I am looking for a decent library of string manipulation
- >functions like I am used to in TurboPascal (ie. Copy, Delete, etc.).
- Can
- >anybody direct me to the these?
-
- Mike,
-
- There are over 2 dozen standard, built-in functions for manipulating
- strings in 'C' - way more than Pascal ever offered. The functions are
- prototyped in an include file <string.h> and are explained in any 'C'
- book. Following is a partial list. Please note that you must understand
- 'C' strings and pointers to use the string functions.
-
- strcpy - copy one string to another
- strcat - concatenate one string on the end of another
- strtok - parse a string based on one or more characters used as
- delimiters
- strcmp - compare 2 strings to see if there are the same (case sensitive)
- stricmp - same as above, but case insensitive
- strstr - search for a substring in a string
- strchr - search for a character in a string
- strrev - reverse a string
- sprintf - format non-stirngs variables into a string
- atoi - xlat a string to an integer (like BASIC's VAL fn)
- itoa - xlat an integer to a string (like BASIC's STR fn)
-
- There are alot more, but for the newbie, they are not easy to use. Please
- remember to learn about strings and pointers before you plunge too
- deeply.
-
- Hope this helps,
- Greg DiGiorgio
-
-
-
-
-
-